package com.tledu.dangjian.service.impl;

import com.tledu.dangjian.dao.IBaseDao;
import com.tledu.dangjian.service.IBaseService;
import lombok.AllArgsConstructor;

import java.util.List;

/**
 * @author cyrus
 */
@AllArgsConstructor
public class BaseServiceImpl<T, E extends IBaseDao<T>> implements IBaseService<T> {

    protected final E baseDao;

    @Override
    public T selectById(int id) {
        return baseDao.selectById(id);
    }

    @Override
    public Integer insert(T entity) {
        return baseDao.insert(entity);
    }

    @Override
    public int update(T entity) {
        return baseDao.update(entity);
    }

    @Override
    public int delete(int id) {
        return baseDao.delete(id);
    }

    @Override
    public List<T> list(T entity) {
        return baseDao.list(entity);
    }
}
